<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/3
  Time: 16:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
            <div class="container" style="height:400px">
                <div id="toolbarCellstack" class="col-lg-6 col-md-offset-2">
                    <div class="input-group">
                        <input type="text" class="form-control" id="productNamezhd" placeholder="请输入要查询的产品">
                        <span class="input-group-btn">
                     <button class="btn btn-primary" onclick="queryByCellstack()">查询</button>
                     </span>
                    </div>
                </div>
                <table id="cellchecktab">

                </table>
            </div>


            <!--复核模态框-->
            <div class="modal fade"  tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="cellchckmodal">
                <div class="modal-dialog modal-lg">
                    <div class="modal-content" id="cellcheckzhds">

                    </div>
                </div>
            </div>

            <script>
                $("#cellchecktab").bootstrapTable({
                    url:"queryByCellByCheckTag.action",
                    method:'post',                      //请求方式（*）
                    contentType:"application/x-www-form-urlencoded", //如果用tomcat就要写这个
                    toolbar:"#toolbarcellstack ",//工具按件用那个容器
                    striped: true,//是否显示隔行变色
                    cache: false,//是否缓存
                    pagination: true,//是否显示分页
                    sortable: true,//是否显示排序
                    sortOrder: "aso",//排序方式
                    sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,//初始化加载第一页，默认第一页,并记录
                    pageSize: 5,//每页记录数
                    pageList: [5, 10, 15, 20],//可供选择的每页的行数（*）
                    search: false,//是否显示输入框
                    strictSearch: true,
                    showColumns: true,//是否显示所有的列（选择显示的列）
                    showRefresh: true,//是否显示刷新按钮
                    minimumCountColumns: 2,//最少允许的列数
                    clickToSelect: true,//是否启用点击选中行
                    uniqueId:"productid",//每一行的唯一标识，一般为主键列
                    showToggle: true,//是否显示详细视图和列表视图的切换按钮
                    cardView: false,//是否显示详细视图
                    detailView: false,//是否显示父子表
                    //获取查询到的参数
                    queryParams: function (params) {
                        var cells={
                            pagesize:params.limit,
                            pageno:(params.offset/params.limit)+1,
                            sort:params.sort,
                            sortOrder:params.sort,
                            productName:$("#productNamezhd").val()
                        }
                        return cells;
                    },
                    columns:[
                        {
                            field:"storeId",
                            title:"库存编号",
                        },
                        {
                            field:'productId',
                            title:'产品编号',
                        },{
                            field:"productName",
                            title:"产品名称",
                        },{
                            field:"file.productclass",
                            title:"档次级别",
                            formatter:function (value,row,index) {
                                if(row.file.productclass=="D001-1"){
                                    return "高档"
                                }
                                if(row.file.productclass=="D001-2"){
                                    return "中档"
                                }
                                if(row.file.productclass=="D001-3"){
                                    return "低档"
                                }
                            }
                        }
                        ,{
                            field:"file.type",
                            title:"用途类型",
                            formatter:function (value,row,index) {
                                if(row.file.type=="Y001-1"){
                                    return "商品"
                                }
                                if(row.file.type=="Y001-2"){
                                    return "物料"
                                }
                            }
                        },{
                            field:"firstKindName",
                            title:"|级分类",
                        },{
                            field:"secondKindName",
                            title:"||级分类",
                        },{
                            field:"thirdKindName",
                            title:"|||级分类",
                        },{
                            field:"registerTime",
                            title:"登记时间",
                        }
                        ,{
                            field:"",
                            title:"复核",
                            formatter:function (value,row,index) {
                                return "<input type='button' value='复核' onclick='showcellstockmodal("+row.id+")' class='btn btn-success'>"
                            }
                        }
                    ]
                })
                //查询
                function queryByCellstack() {
                    $("#cellchecktab").bootstrapTable("refresh")
                }

                //复核模态框
                function showcellstockmodal(id) {
                    $("#cellcheckzhds").load("cellcheckmodal.jsp",{id:id})
                    $("#cellchckmodal").modal("show")
                }
            </script>
</body>
</html>
